<div class="header_menu">
  <ul class='parent'>
    <?
      $title_lang= field('title');
      $count=1;
      //pr($Menu,1);
      foreach($Menu as $M){
	  switch($this->uri->segment(1))
	  {
		case 'vi':
			$title = $M->title_vi;
			break;
		case 'en':
			$title = $M->title_en;
			break;
		case 'gr':
			$title = $M->title_gr;
			break;
	  }
    ?>
	<?php 
	if($count != 1){
	?>
		<li class="img_gach" <?php if($this->uri->segment(1) == 'vi'){ echo 'style="padding:0 14px !important;"';}?>></li>
	<?php 
	}
	?>
    <li <?php if($count == 1){ echo 'style="padding-left:7px;"';} ?>>
      <?
        $link= PATH_URL_LANG.$M->link; $style= '';
      ?>
      <a href="<?=$link?>" <?=$style?> class="<?php if($this->uri->segment(2) == $M->slug) { print 'active';} ?>" ><?=$title?></a>
      <?if(!empty($M->submenu)){ ?>
      <div class="sub_menu">
        <div class="sub_menu_content">
          <ul>
            <?
              foreach($M->submenu as $sub){
                $class_sub=($this->uri->segment(3)==$sub->slug)?'class="sub_active"':'';
              ?>
                <li <?=$class_sub?>><a href="<?=PATH_URL_LANG.$sub->link?>" title="<?=SEO_TITLE($sub->$title_lang)?>"><?=$sub->$title_lang?></a></li>
              <?
              }
            ?>
          </ul>
        </div>
      </div>
      <?
        }
      ?>
    </li>
    <?
      $count++;
      }
    ?>
  </ul>
  <div class="clearAll"></div>
</div>
